package com.beamfield.dao.material;

import com.beamfield.model.DemandDetail;
import com.beamfield.modelVo.DemandDetailVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface DemandDetailMapper {
    int deleteByPrimaryKey(Long id);

    int insert(DemandDetail record);

    int insertSelective(DemandDetail record);

    DemandDetail selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(DemandDetail record);

    int updateByPrimaryKey(DemandDetail record);

    List<DemandDetailVo> selectDetailsByDemandId(@Param("demandId") String demandId,
                                                 @Param("suppliesName") String suppliesName,
                                                 @Param("projectId") String projectId,
                                                 @Param("offset") String offset,
                                                 @Param("limit") String limit);

    long countDetailsByDemandId(@Param("demandId") String demandId,@Param("suppliesName") String suppliesName);

    double getAlreadyDemandNum(@Param("projectId") long projectId,@Param("suppliesId") String suppliesId);
}